home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 47
/
Amiga Format AFCD47 (Issue 131, Xmas 1999).iso
/
-serious-
/
misc
/
football_upd
/
exec
/
alt_results.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-10-04
|
6KB
|
183 lines
/* ***********************************************************************
RESULTS PROGRAM FOR FOOTBALL REXX SUITE
---------------------------------------
Copyright Mark Naughton 1996
Version Date History
--------------------------------------------------------------------------
1.0 270996 First release. Displays all results from 'Teams.sf'
file.
1.1 121196 Updated to get arguments and to use '*.sflearn' to get
a true display as '.sf' was in order. Now called as a
component of FOOTBALL.
131196 Added checks for files - if not found, exits without
a message.
211196 Updated and tidied the display.
190497 Added title to display.
1.2 060997 Amended to handle new Automatic Scheduling schedules.
Removed - new program for this. Formatting needs to be
handled properly.
151297 Tidied display.
180499 Improved match/fixture display.
310599 Changed to accommodate extra data in '.sflearn' file.
1.3 280699 Added and changed code to run the same as the alternative
displays for League, to display goal scorers, bookings,
substitutes, referees and attendances.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open file and print all lines without '*' with the exception of
the league name which is underlined. Build table of player information
and match information then display.
3. Close file and exit.
************************************************************************** */
ARG league_file
version = 1
league_file = "Data/" || league_file
input_file = '.sflearn'
separator = '*'
separator2 = '**'
home. = '???'
hct = 0
away. = '???'
act = 0
hmkr = -1
amkr = -1
if exists(league_file || input_file) = 0 then exit
spaces = left(" ",30,' ')
do i=1 to 99
home.i = spaces
away.i = spaces
end
referee = ""
attend = ""
if open(datafile,league_file || input_file,'r') then do
say
say center("Display League Results",78)
say "-------------------------------------------------------------------------------"
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
if act = 0 & hct = 0 then do
say
say
say
end
if act > 0 | hct > 0 then do
if hct > act then
mloop = hct
else
mloop = act
say
do ii=1 to mloop
t2 = home.ii
t3 = away.ii
say left(strip(t2),30,' ')" "left(strip(t3),30,' ')
home.ii = spaces
away.ii = spaces
end
say
if referee ~= "" then
say "Referee : "referee
if attend ~= "" then
say "Attendance : "attend
referee = ""
attend = ""
say
say
say
act = 0
hct = 0
end
say line
end
else do
if pos(separator2,line) > 0 then do
say subword(line,2)
uline = ''
do i=1 to length(subword(line,2))
uline = insert('-',uline,i,1)
end
say strip(uline)
say
end
else do
if pos("*ATD=",line) > 0 then
attend = delstr(line,1,5)
if pos("*RF=",line) > 0 then
referee = delstr(line,1,4)
if pos("*HG=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)
if pos("(P)",home.hct) > 0 then do
lk = pos("(P)",home.hct)
home.hct = overlay("pen",home.hct,lk,3)
end
end
if pos("*AG=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)
if pos("(P)",away.act) > 0 then do
lk = pos("(P)",away.act)
away.act = overlay("pen",away.act,lk,3)
end
end
if pos("*HY=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" booked."
end
if pos("*AY=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" booked."
end
if pos("*HR=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" sent off."
end
if pos("*AR=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" sent off."
end
if pos("*HS=",line) > 0 then do
hct = hct + 1
home.hct = delstr(line,1,4)" subs."
end
if pos("*AS=",line) > 0 then do
act = act + 1
away.act = delstr(line,1,4)" subs."
end
if pos("*HM=",line) > 0 then do
hct = hct + 1
home.hct = "Man Of Match: "delstr(line,1,4)
end
if pos("*AM=",line) > 0 then do
act = act + 1
away.act = "Man Of Match: "delstr(line,1,4)
end
end
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say "ERROR : (Results)"
say
say "Cannot open '"league_file||input_file"' for reading."
end
exit